package com.medicine.hbp.adapter;

import java.util.List;

import com.medicine.hbp.adapter.InterestOneAdapter.viewHolder;
import com.medicine.hbp.mob.InterestListVo;
import com.medicine.hbp.R;

import android.app.Activity;
import android.text.TextUtils;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout.LayoutParams;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class InterestTwoAdapter extends BaseAdapter {
	private Activity activity;
	private List<InterestListVo> info;

	public InterestTwoAdapter(Activity activity, List<InterestListVo> info) {
		this.activity = activity;
		this.info = info;
	}

	@Override
	public int getCount() {
		return info.size();
	}

	@Override
	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		return arg0;
	}

	@Override
	public long getItemId(int arg0) {
		// TODO Auto-generated method stub
		return arg0;
	}

	@Override
	public View getView(int arg0, View view, ViewGroup arg2) {
		viewHolder holder=null;
		if(view==null){
			holder=new viewHolder();
			view=LayoutInflater.from(activity).inflate(R.layout.item_interest, null);
			holder.text=(TextView)view.findViewById(R.id.txt);
			view.setTag(holder);
		}else{
			holder=(viewHolder)view.getTag();
		}
		String name =info.get(arg0).appTypeName;
		if(!TextUtils.isEmpty(name)){
			holder.text.setText(name);
		}
		return view;
	}
	class viewHolder{
		TextView text;
	}
}
